/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI.Menu;

import GUI.FrameControlHeThong.JIFDoiMatKhau;
import GUI.FrameControlHeThong.JIFPhanQuyen;
import GUI.FrameControlHeThong.JIFInfo;
import GUI.FrameControlHeThong.JIFSaoLuuData;
import GUI.FrameControlHeThong.JIFXoaData;
import java.beans.PropertyVetoException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ImageIcon;
import javax.swing.JDesktopPane;
import javax.swing.JOptionPane;

/**
 *
 * @author 10520_000
 */
public class JIFHeThong extends javax.swing.JInternalFrame {

    private JDesktopPane desktop;
    /**
     * Creates new form JIFDanhMuc
     */
    public JIFHeThong() throws PropertyVetoException {
        
        this.setFrameIcon(new ImageIcon("src/Image/login.png"));
       javax.swing.plaf.InternalFrameUI gui  = this.getUI();  
            ((javax.swing.plaf.basic.BasicInternalFrameUI)gui).setNorthPane(null);
        initComponents();
        
        
    }
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        jTree1 = new javax.swing.JTree();
        jPanelHeThong = new javax.swing.JPanel();
        jLabelTieuDe5 = new javax.swing.JLabel();
        jButtonCapQuyen = new javax.swing.JButton();
        jButtonChangePass = new javax.swing.JButton();
        jButtonNhomBackupData = new javax.swing.JButton();
        jButtonDelData = new javax.swing.JButton();
        jButtonPhucHoiData = new javax.swing.JButton();

        jScrollPane1.setViewportView(jTree1);

        setClosable(true);
        setIconifiable(true);
        setMaximizable(true);
        setMaximumSize(new java.awt.Dimension(80, 80));
        addComponentListener(new java.awt.event.ComponentAdapter() {
            public void componentMoved(java.awt.event.ComponentEvent evt) {
                formComponentMoved(evt);
            }
        });

        jPanelHeThong.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jLabelTieuDe5.setBackground(new java.awt.Color(255, 153, 255));
        jLabelTieuDe5.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
        jLabelTieuDe5.setForeground(new java.awt.Color(255, 255, 255));
        jLabelTieuDe5.setText("Hệ thống");

        jButtonCapQuyen.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/quyen.png"))); // NOI18N
        jButtonCapQuyen.setText("Cấp quyền sử dụng");
        jButtonCapQuyen.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jButtonCapQuyen.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonCapQuyenActionPerformed(evt);
            }
        });

        jButtonChangePass.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/key.png"))); // NOI18N
        jButtonChangePass.setText("Đổi mật khẩu");
        jButtonChangePass.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jButtonChangePass.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonChangePassActionPerformed(evt);
            }
        });

        jButtonNhomBackupData.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/backup.png"))); // NOI18N
        jButtonNhomBackupData.setText("Sao lưu/ Phục hồi dữ liệu");
        jButtonNhomBackupData.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jButtonNhomBackupData.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonNhomBackupDataActionPerformed(evt);
            }
        });

        jButtonDelData.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/if.png"))); // NOI18N
        jButtonDelData.setText("Thông tin chương trình");
        jButtonDelData.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jButtonDelData.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonDelDataActionPerformed(evt);
            }
        });

        jButtonPhucHoiData.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/deldata.png"))); // NOI18N
        jButtonPhucHoiData.setText("Xóa tất cả dữ liệu");
        jButtonPhucHoiData.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jButtonPhucHoiData.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonPhucHoiDataActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanelHeThongLayout = new javax.swing.GroupLayout(jPanelHeThong);
        jPanelHeThong.setLayout(jPanelHeThongLayout);
        jPanelHeThongLayout.setHorizontalGroup(
            jPanelHeThongLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelHeThongLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelHeThongLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabelTieuDe5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelHeThongLayout.createSequentialGroup()
                        .addGroup(jPanelHeThongLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jButtonDelData, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButtonNhomBackupData, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButtonChangePass, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButtonCapQuyen, javax.swing.GroupLayout.DEFAULT_SIZE, 205, Short.MAX_VALUE)
                            .addComponent(jButtonPhucHoiData, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addContainerGap())))
        );
        jPanelHeThongLayout.setVerticalGroup(
            jPanelHeThongLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelHeThongLayout.createSequentialGroup()
                .addComponent(jLabelTieuDe5, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonCapQuyen)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonChangePass)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonNhomBackupData)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonPhucHoiData)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonDelData)
                .addContainerGap(53, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanelHeThong, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanelHeThong, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void formComponentMoved(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentMoved
        // TODO add your handling code here:
        // TODO add your handling code here:
        if(this.getLocation().y < 0){
            this.setLocation(this.getLocation().x, 0);
        }
        
        if(this.getLocation().x < 0){
            this.setLocation(0, this.getLocation().y);
        }
        
    }//GEN-LAST:event_formComponentMoved

    private void jButtonCapQuyenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCapQuyenActionPerformed
        // TODO add your handling code here:
//        if(desktop.getComponentCount() != 0)
//            desktop.getComponent(0).setVisible(false);
//        desktop.removeAll();
//        JIFPhanQuyen frame;
//        try {
//            frame = new JIFPhanQuyen();
//            frame.setVisible(true);
//            getDesktop().add(frame);
//            frame.setSelected(true);
//        } catch (PropertyVetoException ex) {
//            Logger.getLogger(JIFDanhMuc.class.getName()).log(Level.SEVERE, null, ex);
//        }
        
        Object[] options = {"Thoát"};
            int n = JOptionPane.showOptionDialog(this, "Xin lỗi! Chức năng đang trong quá trình xây dựng", "Thông báo",
                    JOptionPane.OK_OPTION,
                    JOptionPane.INFORMATION_MESSAGE, null, options, options[0]);
    }//GEN-LAST:event_jButtonCapQuyenActionPerformed

    private void jButtonChangePassActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonChangePassActionPerformed
        // TODO add your handling code here:
//        if(desktop.getComponentCount() != 0)
//            desktop.getComponent(0).setVisible(false);
//        desktop.removeAll();
//        JIFDoiMatKhau frame;
//        try {
//            frame = new JIFDoiMatKhau();
//            frame.setVisible(true);
//            getDesktop().add(frame);
//            frame.setSelected(true);
//        } catch (PropertyVetoException ex) {
//            Logger.getLogger(JIFDanhMuc.class.getName()).log(Level.SEVERE, null, ex);
//        }
        Object[] options = {"Thoát"};
            int n = JOptionPane.showOptionDialog(this, "Xin lỗi! Chức năng đang trong quá trình xây dựng", "Thông báo",
                    JOptionPane.OK_OPTION,
                    JOptionPane.INFORMATION_MESSAGE, null, options, options[0]);
    }//GEN-LAST:event_jButtonChangePassActionPerformed

    private void jButtonNhomBackupDataActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonNhomBackupDataActionPerformed
        // TODO add your handling code here:
//        if(desktop.getComponentCount() != 0)
//            desktop.getComponent(0).setVisible(false);
//        desktop.removeAll();
//        JIFSaoLuuData frame;
//        try {
//            frame = new JIFSaoLuuData();
//            frame.setVisible(true);
//            getDesktop().add(frame);
//            frame.setSelected(true);
//        } catch (PropertyVetoException ex) {
//            Logger.getLogger(JIFDanhMuc.class.getName()).log(Level.SEVERE, null, ex);
//        }
        Object[] options = {"Thoát"};
            int n = JOptionPane.showOptionDialog(this, "Xin lỗi! Chức năng đang trong quá trình xây dựng", "Thông báo",
                    JOptionPane.OK_OPTION,
                    JOptionPane.INFORMATION_MESSAGE, null, options, options[0]);
    }//GEN-LAST:event_jButtonNhomBackupDataActionPerformed

    private void jButtonPhucHoiDataActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonPhucHoiDataActionPerformed
        // TODO add your handling code here:
//        if(desktop.getComponentCount() != 0)
//            desktop.getComponent(0).setVisible(false);
//        desktop.removeAll();
//        JIFInfo frame;
//        try {
//            frame = new JIFInfo();
//            frame.setVisible(true);
//            getDesktop().add(frame);
//            frame.setSelected(true);
//        } catch (PropertyVetoException ex) {
//            Logger.getLogger(JIFDanhMuc.class.getName()).log(Level.SEVERE, null, ex);
//        }
        Object[] options = {"Thoát"};
            int n = JOptionPane.showOptionDialog(this, "Xin lỗi! Chức năng đang trong quá trình xây dựng", "Thông báo",
                    JOptionPane.OK_OPTION,
                    JOptionPane.INFORMATION_MESSAGE, null, options, options[0]);
    }//GEN-LAST:event_jButtonPhucHoiDataActionPerformed

    private void jButtonDelDataActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonDelDataActionPerformed
        // TODO add your handling code here:
        if(desktop.getComponentCount() != 0)
            desktop.getComponent(0).setVisible(false);
        desktop.removeAll();
        JIFInfo frame;
        try {
            frame = new JIFInfo();
            frame.setVisible(true);
            getDesktop().add(frame);
            frame.setSelected(true);
        } catch (PropertyVetoException ex) {
            Logger.getLogger(JIFDanhMuc.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jButtonDelDataActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButtonCapQuyen;
    private javax.swing.JButton jButtonChangePass;
    private javax.swing.JButton jButtonDelData;
    private javax.swing.JButton jButtonNhomBackupData;
    private javax.swing.JButton jButtonPhucHoiData;
    private javax.swing.JLabel jLabelTieuDe5;
    private javax.swing.JPanel jPanelHeThong;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTree jTree1;
    // End of variables declaration//GEN-END:variables

    /**
     * @return the desktop
     */
    public JDesktopPane getDesktop() {
        return desktop;
    }

    /**
     * @param desktop the desktop to set
     */
    public void setDesktop(JDesktopPane desktop) {
        this.desktop = desktop;
    }
}
